package paperockscissors;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Player 
{
	private String name;
	private int score;
	private List<RPSEnum> moves;
	
	//Constructor
	public Player(String name, int score, List<RPSEnum> moves)
	{
		this.name=name;
		this.setScore(score);
		this.moves=moves;
	}
	
	public Player(String name)
	{
		//Initialize data
		this.name=name;
		this.setScore(0);
		
		//Create the list of move
		moves=new ArrayList<RPSEnum>();

		//Populate it with 20 random moves
		for(int i=0; i<20; i++) 
		{
			Random rand = new Random();
			
			switch(rand.nextInt(3)) //number between 0 and 2
			{
				case 0: moves.add(RPSEnum.PAPER);
						break;
				case 1: moves.add(RPSEnum.ROCK);
						break;
				case 2: moves.add(RPSEnum.SCISSORS);
						break;
				default: System.out.println("Error with the populate of moves");
						 break;
			}
		}
	}

	public String getName() {
		return name;
	}

	public int getScore() {
		return score;
	}
	
	public int getNbRPSEnum() {
		return moves.size();
	}

	public void setScore(int score) {
		this.score = score;
	}

	public List<RPSEnum> getMoves() {
		return moves;
	}

}
